<!DOCTYPE HTML>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>

<div role="grid" id="grid"></div>
<div role="treegrid" id="treegrid"></div>
<div role="tree" id="tree"></div>
<div role="listbox" id="listbox"></div>
<div role="tablist" id="tablist"></div>

<div role="grid" id="multi-grid" aria-multiselectable="true"></div>
<div role="treegrid" id="multi-treegrid" aria-multiselectable="true"></div>
<div role="tree" id="multi-tree" aria-multiselectable="true"></div>
<div role="listbox" id="multi-listbox" aria-multiselectable="true"></div>
<div role="tablist" id="multi-tablist" aria-multiselectable="true"></div>

<div role="radiogroup" id="radiogroup" aria-multiselectable="true"></div>
<div role="menu" id="menu" aria-multiselectable="true"></div>
<script>
function axElementById(id) {
    return accessibilityController.accessibleElementById(id);
}

test(function(t) {
    var container = axElementById("grid");
    assert_equals(container.isMultiSelectable, false);
}, "multiselectable=false by default on grid");

test(function(t) {
    var container = axElementById("treegrid");
    assert_equals(container.isMultiSelectable, false);
}, "multiselectable=false by default on treegrid");

test(function(t) {
    var container = axElementById("tree");
    assert_equals(container.isMultiSelectable, false);
}, "multiselectable=false by default on tree");

test(function(t) {
    var container = axElementById("listbox");
    assert_equals(container.isMultiSelectable, false);
}, "multiselectable=false by default on listbox");

test(function(t) {
    var container = axElementById("tablist");
    assert_equals(container.isMultiSelectable, false);
}, "multiselectable=false by default on tablist");

test(function(t) {
    var container = axElementById("multi-grid");
    assert_equals(container.isMultiSelectable, true);
}, "multiselectable can be set on grid");

test(function(t) {
    var container = axElementById("multi-treegrid");
    assert_equals(container.isMultiSelectable, true);
}, "multiselectable can be set on treegrid");

test(function(t) {
    var container = axElementById("multi-tree");
    assert_equals(container.isMultiSelectable, true);
}, "multiselectable can be set on tree");

test(function(t) {
    var container = axElementById("multi-listbox");
    assert_equals(container.isMultiSelectable, true);
}, "multiselectable can be set on listbox");

test(function(t) {
    var container = axElementById("multi-tablist");
    assert_equals(container.isMultiSelectable, true);
}, "multiselectable can be set on tablist");

test(function(t) {
    var container = axElementById("radiogroup");
    assert_equals(container.isMultiSelectable, false);
}, "multiselectable cannot be set on radiogrup");

test(function(t) {
    var container = axElementById("menu");
    assert_equals(container.isMultiSelectable, false);
}, "multiselectable cannot be set on menu");
</script>
